<template>
  <van-list
    v-model:loading="loading"
    :finished="finished"
    finished-text="没有更多了"
    @load="onLoad"
    :offset="10"
  >
    <!-- @click="router.push(`/article-detail?articleId=${collect.article.id}`)" -->
    <van-card
    :key="collect"
      class="item"
      v-for="collect in list"
      :thumb="collect.article.picUrl"
      @click="
        router.push({
          path: '/article-detail',
          query: { articleId: collect.article.id, a: 666 },
        })
      "
    >
      <template #title>
        <p class="title">
          {{ collect.article.title }}
        </p>
      </template>
      <template #price>
        <p class="desc">
          {{ collect.article.desc }}
        </p>
      </template><!--  -->
      <template #num>
        <p>{{ collect.created_at }}</p>
      </template>
    </van-card>
  </van-list>
</template>
<script setup>
import { praiseList } from "@/api/praise";
import usePageList from "@/Hooks/usePageList";
import { useRouter } from "vue-router";

let router = useRouter();

let { loading, finished, onLoad, list } = usePageList(praiseList, {
  page: 1,
  limit: 10,
  type: 2,/*  */
});
// console.log(loading.value,finished.value,onLoad(),list.value);
</script>

<style scoped lang="scss">
.item {
  //   height: 100px;
  //   background-color: antiquewhite;
  margin-bottom: 10px;
}
</style>